package com.xm.hiber;

import com.xm.hiber.dao.ClassRoomDao;
import com.xm.hiber.dao.StudentDao;
import com.xm.hiber.entity.ClassRoom;
import com.xm.hiber.entity.Student;


public class App {
    public static void main(String[] args) {

        ClassRoom classRoom = new ClassRoom("class one", "class one");
        ClassRoom classRoom1 = new ClassRoom("class two", "class two");

        ClassRoomDao classRoomDao =  new ClassRoomDao();
        classRoomDao.saveClassRoom(classRoom);
        classRoomDao.saveClassRoom(classRoom1);

        StudentDao studentDao = new StudentDao();

//        Student student = new Student("Ramesh", "Fadatare", "ramesh@javaguides.com");
//        student.setClassRoom(classRoom);
//        Student student1 = new Student("Json", "Blue", "ramesh@javaguides.com");
//        student.setClassRoom(classRoom);
//
//        Student student2 = new Student("Jack", "Black", "ramesh@javaguides.com");
//        student.setClassRoom(classRoom1);
//        Student student3 = new Student("Jet", "Wrong", "ramesh@javaguides.com");
//        student.setClassRoom(classRoom1);

        Student student = new Student("Ramesh", "Fadatare", "ramesh@javaguides.com", classRoom);
        Student student1 = new Student("Json", "Blue", "ramesh@javaguides.com", classRoom);


        Student student2 = new Student("Jack", "Black", "ramesh@javaguides.com", classRoom1);
        Student student3 = new Student("Jet", "Wrong", "ramesh@javaguides.com", classRoom1);

        studentDao.saveStudent(student);
        studentDao.saveStudent(student1);
        studentDao.saveStudent(student2);
        studentDao.saveStudent(student3);

        System.out.println(studentDao.getStudent(1));

    }
}
